/**
 * 
 */
package com.google.code.netz.wfe.internal;

import java.util.Collections;
import java.util.List;

import com.google.code.netz.wfe.model.ICase;
import com.google.code.netz.wfe.model.IResource;
import com.google.code.netz.wfe.model.IResult;
import com.google.code.netz.wfe.model.ITask;

/**
 * Common base class for {@link ICase} related internal Tasks.
 * 
 * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
 * @since 1.0
 * @version $Id: AbstractCaseTask.java 17 2009-02-09 13:08:49Z rahul.thakur.xdev
 *          $
 */
public abstract class AbstractCaseTask implements ITask {
	/**
	 * {@link ICase} to be opened.
	 */
	private ICase<?> kase;

	/**
	 * IResource to be verified for appropriate privileges with respect to the
	 * specified ICase.
	 */
	private IResource resource;

	/**
	 * @param kase
	 *            {@link ICase} to be opened.
	 * @param resource
	 *            IResource to be verified for appropriate privs.
	 *            (<i>Experimental</i>)
	 */
	public AbstractCaseTask(ICase<?> kase, IResource resource) {
		super();
		this.kase = kase;
		this.resource = resource;
	}

	protected ICase<?> getCase() {
		return this.kase;
	}

	protected IResource getResource() {
		return this.resource;
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.google.code.netz.wfe.model.ITask#addResult(com.google.code.netz.wfe
	 *      .model.IResult)
	 */
	@Override
	public void addResult(IResult result) {
		// do nothing by default
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.google.code.netz.wfe.model.ITask#getDeclaredResults()
	 */
	@Override
	public List<IResult> getDeclaredResults() {
		return Collections.EMPTY_LIST;
	}

}
